import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2022-10-07
 * Time:21:06
 */
public class TestString {
    public static void main1(String[] args) {
        String s1=new String("abcd");
        String s2=new String("abcd");
        System.out.println(s1==s2);
    }

    public static void main2(String[] args) {
        int a=10;
        int b=10;
        System.out.println(a==b);
        String s1=new String("abcd");
        String s2=new String("abcd");
        System.out.println(s1==s2);
        System.out.println(s1.equals(s2));
    }

    public static void main3(String[] args) {
        String s1=new String("abcd");
        String s2=new String("Abcd");
        String s3=new String("abcd");
        String s4=new String("abcdefg");
        System.out.println(s1.compareTo(s2));
        System.out.println(s1.compareTo(s3));
        System.out.println(s1.compareTo(s4));
    }

    public static void main4(String[] args) {
        String s=new String("abcdefg");
        int i='c';
        System.out.println(s.indexOf(99));
        System.out.println(s.indexOf(i));
        System.out.println('c');
        System.out.println(i);
        System.out.println(s.indexOf('c',1));
    }

    public static void main5(String[] args) {
        String str="asdfADS";
        String str2=str.toLowerCase();
        System.out.println(str.toLowerCase());
        System.out.println(str.toUpperCase());
        System.out.println(str2);
    }

    public static void main6(String[] args) {
        String str="sadsa";
        char []chars=str.toCharArray();
        System.out.println(Arrays.toString(chars));
    }

    public static void main7(String[] args) {
        String str="dsafsadsaf";
        String str1=str.replaceAll("a","c");
        String str2=str.replaceFirst("a","z");
        System.out.println(str1);
        System.out.println(str2);
    }

    public static void main8(String[] args) {
        String str="dsa dsa dsa dsa";
        String []strings =str.split(" ");
        System.out.println(Arrays.toString(strings));
    }

    public static void main9(String[] args) {
        String str="dsa dsa dsa dsa";
        String str1=str.substring(4);
        String str2=str.substring(4,6);
        System.out.println(str1);
        System.out.println(str2);
    }

    public static void main(String[] args) {
        String str1="asdf";
        String str2="asdf";
        String str3=new String("asdf");
        String str4=new String("asdf");

    }
}
